package com.heima.media.controller;

import com.heima.common.dto.ResponseResult;
import com.heima.media.dto.WmUserDto;
import com.heima.media.service.IWmUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 管理员用户信息表 前端控制器
 * </p>
 *
 * @author SpaceTraveller
 * @since 2022-11-06
 */
@RestController
@RequestMapping("/login")
@Api(tags = "用户信息表接口")
public class LoginController {

    @Autowired
    private IWmUserService wmUserService;

    @PostMapping("/in")
    @ApiOperation(value = "用户登录请求",notes = "author:SpaceTraveller")
    @ApiImplicitParam(name = "dto",value = "请求体对象",required = true,dataType = "WmUserDto")
    public ResponseResult<Map<String,Object>> adminLogin(@RequestBody WmUserDto dto){
        return wmUserService.wmUserDtoLogin(dto);
    }


}
